package com.sunshin.staticfactorymethod;

/**
 * 性别的静态工厂方法
 * @Author: WeiHong
 * @Date: 2017/3/28 9:49
 */
public class Gender {

    private String description;

    private static final Gender female = new Gender("女");

    private static final Gender male = new Gender("男");

    public static Gender getFemale(){
        return female;
    }

    public static Gender getMale(){
        return male;
    }

    private Gender(String description){
        this.description = description;
    }

    public String getDescription() {
        return description;
    }
}
